Skip to content

test: Add control flow integrity sanitizer.#2399

Closed
iphydf wants to merge 1 commit into
TokTok:masterfrom
iphydf:cfisan
Closed

test: Add control flow integrity sanitizer.#2399
iphydf wants to merge 1 commit into
TokTok:masterfrom
iphydf:cfisan

Conversation

@iphydf
Copy link
Copy Markdown
Member

@iphydf iphydf commented Aug 30, 2023

This will check whether conversions to and casts from void* are correct. E.g. int* -> void* -> float* will trip the sanitizer.

https://clang.llvm.org/docs/ControlFlowIntegrity.html


This change is Reviewable

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 30, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.38%. Comparing base (84ba154) to head (bb8356d).
⚠️ Report is 376 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2399      +/-   ##
==========================================
+ Coverage   74.35%   74.38%   +0.03%     
==========================================
  Files          87       87              
  Lines       26255    26255              
==========================================
+ Hits        19522    19530       +8     
+ Misses       6733     6725       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread CMakeLists.txt Outdated
################################################################################

cmake_minimum_required(VERSION 2.8.12)
cmake_policy(VERSION 2.8.12)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally

@iphydf iphydf modified the milestones: v0.2.19, v0.2.20 Nov 7, 2023
This will check whether conversions to and casts from `void*` are
correct. E.g. `int* -> void* -> float*` will trip the sanitizer.

https://clang.llvm.org/docs/ControlFlowIntegrity.html
@Green-Sky
Copy link
Copy Markdown
Member

not sure what version of afl++ we are using, but it can also support cfisan

Comment thread CMakeLists.txt
endif()

include(CheckIPOSupported)
check_ipo_supported()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this without any arguments makes IPO being unsupported a fatal error. I guess we can either set CMAKE_INTERPROCEDURAL_OPTIMIZATION based on if IPO is supported, or only perform this check if CMAKE_INTERPROCEDURAL_OPTIMIZATION is true.

@iphydf iphydf modified the milestones: v0.2.20, v0.2.21 Mar 28, 2024
@iphydf iphydf modified the milestones: v0.2.21, v0.2.x Nov 27, 2024
@iphydf iphydf closed this Jan 1, 2026
@iphydf iphydf deleted the cfisan branch January 1, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants